import request from '@/utils/request.js'

//将针对轮播图carousel的所有请求封装到一个对象里面
const carouselApi = {
	list(carouselQuery) {
		return request.get('/product/carousel/list',{params: carouselQuery})
	},
	deleteById(id) {
		return request.delete( `/product/carousel/deleteById/${id}`)   //反引号，直接写参数。否则需要字符串拼接
	},
	deleteAll(ids) {
		return request.delete( `/product/carousel/deleteAll/${ids}`)
	},
	add(carousel) {
		//carousel以JSON形式传递到后台
		return request.post('/product/carousel/add', carousel)
	},
	selectById(id) {
		return request.get(`/product/carousel/selectById/${id}`)
	},
	update(carousel) {
		return request.put('/product/carousel/update', carousel)
	},
	updateStatus(id,status){
		return request.put(`/product/carousel/updateStatus/${id}/${status}`)
	},
	
}

export default carouselApi